import Vue from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'
import store from './store'
import ElementUI from 'element-ui'
import './assets/css/public.css'
import 'element-ui/lib/theme-chalk/index.css'
import Video from 'video.js'
import 'video.js/dist/video-js.css'
Vue.prototype.$video = Video
Vue.prototype.$http = axios
import 'lib-flexible'
import animated from 'animate.css' // 动画
import lottie from "vue-lottie";
import VueAMap from "vue-amap"; // 高德地图
import MetaInfo from 'vue-meta-info' // 预渲染插件
import VuePhotoZoomPro from 'vue-photo-zoom-pro'
Vue.component("lottie", lottie);
Vue.use(animated)
Vue.use(VueAMap);
Vue.use(ElementUI)
Vue.use(MetaInfo)
Vue.use(VuePhotoZoomPro)
VueAMap.initAMapApiLoader({
  key: "da9df900dbc16ce214c3ef40af94eeb9",
  plugin: [
    "AMap.Autocomplete",
    "AMap.PlaceSearch",
    "AMap.Scale",
    "AMap.OverView",
    "AMap.ToolBar",
    "AMap.MapType",
    "AMap.PolyEditor",
    "AMap.CircleEditor",
    "AMap.Geolocation",
    "AMap.Geocoder"
  ],
  v: "1.4.4",
  uiVersion: "1.0.11"
});
Vue.config.productionTip = false
router.beforeEach((to, from, next) => {
  // chrome
  document.body.scrollTop = 0
  // firefox
  document.documentElement.scrollTop = 0
  // safari
  window.pageYOffset = 0
  next()
});
new Vue({
  router,
  store,
  render: h => h(App),
  mounted () {
  setTimeout(() => {
    document.dispatchEvent(new Event('render-event'))
    // document.dispatchEvent(new Event('custom-render-trigger')) // 预渲染
  }, 5000)
}
}).$mount('#app')
